package uri

import "regexp"
import "fmt"

type URI string

var pattern = regexp.MustCompile( "^[a-z]+:.*$" )

func New( s string ) URI {
  if !pattern.MatchString( s )  { fail( "bad URI '" + s + "'" ); return URI("bad:" + s)  } 
  return URI(s)
}

func (u URI) Spelling() string {
  return string(u)
}

func fail( message string ) {
  fmt.Printf( ">> oops: %v\n", message )
}
